package com.nsn.auction.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.ui.Model;

import com.nsn.auction.service.AuctionService;

@Controller
@RequestMapping("/addAuction")
public class AddAuctionController {
	
	private AuctionService auctionService;
	
	
	@Autowired
	public AddAuctionController(AuctionService auctionService) {
		this.auctionService = auctionService;
	}

	
	@RequestMapping(method = RequestMethod.GET)
	public String addAuction(Model model){
		
		if(auctionService.addAuction(1l)){
			return "addActionSuccess";
		}
		
		return "addActionFail";
	}
}
